package com.hnucm.springboot.controller;

import com.hnucm.springboot.pojo.News;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class JSONController {
    @RequestMapping("getnews")
    @ResponseBody
    public News getnews(){
        News news=new News();
        news.setId(1);
        news.setTitle("新闻标题");
        news.setContent("新闻内容");
        return news;
    }
}
